package com.jiexinyun.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jiexinyun.entity.DeviceInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DeviceInfoMapper extends BaseMapper<DeviceInfoEntity> {

    //mybatis写法
    @Select(value = "SELECT CASE WHEN MAX(sort) IS NULL THEN 1 ELSE MAX(sort) END AS sort FROM wise_device_info")
    Integer findMaxSort();

}
